package com.example.billbillbangumi;

import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.LinearLayoutCompat;
import android.support.v7.widget.LinearLayoutManager;
import android.support.v7.widget.RecyclerView;

import java.util.ArrayList;
import java.util.List;

public class SecondActivity extends AppCompatActivity {
    private List<Bangumi> bangumiList=new ArrayList<>();
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.second_activity);
        initBangumis();
        RecyclerView recyclerView=(RecyclerView)findViewById(R.id.recycle_view);
        LinearLayoutManager linearLayoutManager=new LinearLayoutManager(this);
        recyclerView.setLayoutManager(linearLayoutManager);
        BangumiAdapter bangumiAdapter=new BangumiAdapter(bangumiList);
        recyclerView.setAdapter(bangumiAdapter);
    }
    private void initBangumis(){
            Bangumi bangumi1=new Bangumi("入间同学入魔了",R.drawable.a1);
            bangumiList.add(bangumi1);
            Bangumi bangumi2=new Bangumi("厨病激发男孩",R.drawable.a2);
            bangumiList.add(bangumi2);
            Bangumi bangumi3=new Bangumi("Dr.STONE石纪元",R.drawable.a3);
            bangumiList.add(bangumi3);
            Bangumi bangumi4=new Bangumi("花牌情缘3",R.drawable.a4);
            bangumiList.add(bangumi4);
            Bangumi bangumi5=new Bangumi("放学后桌游俱乐部",R.drawable.a5);
            bangumiList.add(bangumi5);
    }
}
